<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<html>
<head>
<%@include file="/inc/head.jsp"%>
<title>在线辞典</title>
<script type="text/javascript">
var defaultValue = "输入单词、句子、段落...";
function queryDict(){
	var words = document.getElementById("words").value;
	if((!words)||words==defaultValue){
		alert("请输入要查询的单词、句子或段落");
	}else{
		window.open("http://dict.bing.com.cn/#"+words);
	}
}

function clickWords(field){
	if(field.value==defaultValue){
		field.value="";
		field.style.color="black";
	}else{
		field.select();
	}
}
</script>
</head>
<body>
<div><input id="words" type="text" name="words" value="输入单词、句子、段落..." style="color: gray" onclick="clickWords(this)">
<input type="button" name="query" value="查询" onclick="queryDict()"></div>
</body>
</html>